from django.db import models
from django.contrib.auth.models import User 
from datetime import datetime

class Author(models.Model):
    user  = models.ForeignKey(User)
    #R_TYPE  = ( 
    #    (u'Col' , u'Colleage'),
    #    (u'Sup' , u'Supervisor'),
    #    (u'Fri' , u'Friend'),
    #    (u'Cow' , u'Coworker'),
    #    )
    #relation_type = models.CharField(max_length = 5, choices = R_TYPE)
    myauthors = models.ManyToManyField(User, related_name="myauthors")    
    
class Invitation(models.Model):
    from_user = models.ForeignKey(User, related_name="from_user")
    to_user   = models.ForeignKey(User, related_name="to_user")
    message   = models.TextField()
    status    = models.BooleanField(default= True)
    created_date  = models.DateTimeField(default = datetime.now)
    
    def __unicode__(self):
        return "from %s to %s " %( self.from_user.username, self.to_user.username) 

